//
//  MainController.swift
//  I.S.A.P WT
//
//  Created by Илья Проскурнев on 22.05.2020.
//  Copyright © 2020 Илья Проскурнев. All rights reserved.
//

import SwiftUI

class MainController: UIViewController {
    
    @IBOutlet weak var online: UIButton!
    @IBOutlet weak var offline: UIButton!
    
//    var sudiFamTextField: UITextField?
//    var sudiNameTextField: UITextField?
//    var sudiRegionTextField: UITextField?
//    var sudiEmailTextField: UITextField?
//    var sudiPassTextField: UITextField?
//    var defaults = UserDefaults.standard
    
    var name: String?
    var password: String?
    
    var loginAction:UIAlertAction?
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
        self.navigationItem.setHidesBackButton(true, animated: true)
    }
    
//    @IBAction func login(_ sender: Any) {
//        let alert = UIAlertController(title: "Login", message: "Enter username&password", preferredStyle: .alert)
//        // Login button
//        loginAction = UIAlertAction(title: "Login", style: .default, handler: { (action) -> Void in
//            // Get TextFields text
//        })
//
//        alert.addTextField(configurationHandler: {(textField: UITextField) in
//            textField.placeholder = "Enter username"
//            textField.addTarget(self, action: #selector(self.textChanged(sender:)), for: .editingChanged)
//        })
//
//        alert.addTextField(configurationHandler: {(textField: UITextField) in
//            textField.placeholder = "Enter password"
//            textField.isSecureTextEntry = true
//            textField.addTarget(self, action: #selector(self.textChanged(sender:)), for: .editingChanged)
//        })
//
//        // Cancel button
//        let cancel = UIAlertAction(title: "Cancel", style: .destructive, handler: { (action) -> Void in })
//
//        // Add actions
//        alert.addAction(loginAction!)
//        alert.addAction(cancel)
//        loginAction!.isEnabled = false
//        self.present(alert, animated: true, completion: nil)
//    }
//    @objc func textChanged(sender:UITextField) {
//        if sender.text!.count > 0
//        {
//            loginAction?.isEnabled = true
//        } else {
//            loginAction?.isEnabled = false
//        }
//    }
}
